<?xml version="1.0" encoding="utf-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">
<ui:composition template="/templates/impressao.xhtml">

	<h:outputStylesheet library="css" name="relatorio.css" />

    <f:metadata>
        <f:event listener="#{amostrasRelatorioBean.carregarAmostra()}" type="preRenderView" />
    </f:metadata>

    <ui:define name="title">#{appMessages['amostras.relatorio.titulo']}</ui:define>
    
    <style type="text/css">

    
    .tabela-parametros {
        margin: 1.5em auto;
        width: 600px;
    }
    
    .tabela-iqa {
        color: ##{amostrasRelatorioBean.amostra.qualidade.cor};
        font-weight: bold;
    }
    
    .graficos {
        margin: 0 auto;
    }
    
    .graficos td {
        vertical-align: top;
    }
    </style>
    
    <div class="header">
        <h:graphicImage library="img" name="logo-min.png" />
        
        <p>
        	<strong>
            Núcleo Ambiental<br/>
            Consultoria Ambiental em Águas e Efluentes<br/>
            Parecer técnico
            </strong>
        </p>
    </div>

    <div class="conteudo">
        <p>
            Objetivo do parecer: determinação do IQA de amostras de água bruta<br/>
            Data da coleta:
            <h:outputText value="#{amostrasRelatorioBean.amostra.data}">
                <f:convertDateTime dateStyle="long" />
            </h:outputText>
            <br/>Ponto:
            <h:outputText value="#{amostrasRelatorioBean.amostra.pontoColeta.nome}" />
        </p>

        <table class="tabela-parametros">
            <thead>
                <tr>
                    <th>#{appMessages['amostras.relatorio.parametro']}</th>
                    <th>#{appMessages['amostras.relatorio.metodologia']}</th>
                    <th>#{amostrasRelatorioBean.amostra.pontoColeta.nome}</th>
                    <th>#{appMessages['amostras.relatorio.unidade']}</th>
                </tr>
            </thead>

            <tfoot>
                <tr>
                    <td>#{appMessages['amostras.iqa']}</td>
                    <td>#{appMessages['amostras.iqa.metodologia']}</td>
                    <td class="tabela-iqa" style="background-color: ##{amostrasRelatorioBean.amostra.qualidade.corHexa}; color: ##{amostrasRelatorioBean.amostra.qualidade.corHexaTexto};">
                        <h:outputText value="#{amostrasRelatorioBean.amostra.IQA}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.iqa.unidade']}</td>
                </tr>
            </tfoot>

            <tbody>
                <tr>
                    <td>#{appMessages['amostras.coliformesFecais']}</td>
                    <td>#{appMessages['amostras.coliformesFecais.metodologia']}</td>
                    <td>
                        <h:outputText value="#{amostrasRelatorioBean.amostra.coliformesFecais}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.coliformesFecais.unidade']}</td>
                </tr>
                <tr>
                    <td>#{appMessages['amostras.dbo']}</td>
                    <td>#{appMessages['amostras.dbo.metodologia']}</td>
                    <td>
                        <h:outputText value="#{amostrasRelatorioBean.amostra.dbo}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.dbo.unidade']}</td>
                </tr>
                <tr>
                    <td>#{appMessages['amostras.fosforoTotal']}</td>
                    <td>#{appMessages['amostras.fosforoTotal.metodologia']}</td>
                    <td>
                        <h:outputText value="#{amostrasRelatorioBean.amostra.pt}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.fosforoTotal.unidade']}</td>
                </tr>
                <tr>
                    <td>#{appMessages['amostras.nitrogenioTotal']}</td>
                    <td>#{appMessages['amostras.nitrogenioTotal.metodologia']}</td>
                    <td>
                        <h:outputText value="#{amostrasRelatorioBean.amostra.nt}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.nitrogenioTotal.unidade']}</td>
                </tr>
                <tr>
                    <td>#{appMessages['amostras.oxigenioDissolvido']}</td>
                    <td>#{appMessages['amostras.oxigenioDissolvido.metodologia']}</td>
                    <td>
                        <h:outputText value="#{amostrasRelatorioBean.amostra.od}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.oxigenioDissolvido.unidade']}</td>
                </tr>
                <tr>
                    <td>#{appMessages['amostras.ph']}</td>
                    <td>#{appMessages['amostras.ph.metodologia']}</td>
                    <td>
                        <h:outputText value="#{amostrasRelatorioBean.amostra.ph}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.ph.unidade']}</td>
                </tr>
                <tr>
                    <td>#{appMessages['amostras.solidosTotais']}</td>
                    <td>#{appMessages['amostras.solidosTotais.metodologia']}</td>
                    <td>
                        <h:outputText value="#{amostrasRelatorioBean.amostra.st}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.solidosTotais.unidade']}</td>
                </tr>
                <tr>
                    <td>#{appMessages['amostras.temperatura']}</td>
                    <td>#{appMessages['amostras.temperatura.metodologia']}</td>
                    <td>
                        <h:outputText value="#{amostrasRelatorioBean.amostra.temperatura}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.temperatura.unidade']}</td>
                </tr>
                <tr>
                    <td>#{appMessages['amostras.turbidez']}</td>
                    <td>#{appMessages['amostras.turbidez.metodologia']}</td>
                    <td>
                        <h:outputText value="#{amostrasRelatorioBean.amostra.turbidez}">
                            <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
                        </h:outputText>
                    </td>
                    <td>#{appMessages['amostras.turbidez.unidade']}</td>
                </tr>
            </tbody>
        </table>

        <p>
            <h:panelGrid columns="2" styleClass="graficos">
                <p:graphicImage value="#{amostrasRelatorioBean.graficoParametros}" />
                <p:graphicImage value="#{amostrasRelatorioBean.graficoIQA}" />
            </h:panelGrid>
        </p>
    </div>
</ui:composition>
</html>